package com.woniuxy.commons.rabbit;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 黄金生产者
 * <P> Date: 2022/4/21:9:27
 * <P> Description:
 */
@Service
public class GoldService {

    @Resource
    private AmqpTemplate amqpTemplate;

    /**
     * TODO:将消息发送到交换机
     **/
    public boolean send(Object message, String exchange, String routerKey) {
        //TODO
        // 参数1 交换机名
        // 参数2 路由
        // 参数3 消息
        amqpTemplate.convertAndSend(exchange, routerKey, message);
        return true;
    }
}
